<!--
    Copyright 2016-2017, CMCC Technologies Co., Ltd.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link href="/openoui/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" id="font_awesome"/>
		<link href="/openoui/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
		<link href="/openoui/thirdparty/uniform/css/uniform.default.css" rel="stylesheet"/>
		<link href="/openoui/thirdparty/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css" rel="stylesheet">
		<link href="/openoui/thirdparty/icheck/skins/all.css" type="text/css" rel="stylesheet">
		<link href="/openoui/thirdparty/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
		<link href="/openoui/performance/css/plugins.css" rel="stylesheet" type="text/css">
		<link href="/openoui/performance/css/alarmsQuery.css" rel="stylesheet" type="text/css">
		<link href="/openoui/monitor/css/style.css" rel="stylesheet" type="text/css"/>
		<link href="/openoui/monitor/css/ngict-component.css" rel="stylesheet" type="text/css">
	</head>
	<body>
		<div id="alarmsDiv" class="container-fluid ms-controller" ms-controller="curAlarmsController">
			<div class="row" style=" margin-top: 15px;">
				<div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont searchTitle">
					<span id="ngict_fm_iui_curalarm_currentAlarm" name_i18n="openo_alarm_i18n"></span>
				</div>
			</div>
			<div class="separator-line"></div>
			<div class="row-fluid filtergroup">
				<div>
					<div class="btn-group">
						<button class="btn btnWhite circleBtn" ms-repeat-el="severityTypes" ms-class="<!--el.class-->:severityTypes[$index].value" ms-click="tabClicked(el ,this)"><!--el.name--></button>
					</div>
					<div class="btn-group btn-groupBlue">
						<button class="btn btnWhite circleBtn" ms-repeat-el="ackStateTypes" ms-class-blueActive="el.value" ms-click="tabClicked(el ,this)"><!--el.name--></button>
					</div>
					<div class="btn-group btn-groupBlue circleBtn">
						<button class="btn btnWhite circleBtn" ms-repeat-el="filterStateTypes" ms-class-blueActive="el.value" ms-click="tabClicked(el ,this)"><!--el.name--></button>
					</div>
					<div class="btn-group flRight">
						<span class=" adCondition">
							<button id="moreCondBtn" type="button" class="btn radius_l white" ms-click="moreCondClicked()" ms-class-blueActive="vm.moreCondBtn">
								<span class="caret"></span><span id="ngict_fm_iui_curalarm_advance" name_i18n="openo_alarm_i18n"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="row" id="moreCond" style="display: none;">
				<div class="row" style="margin-top: 20px;">
					<span id="alLocation" class="cond_zone">
						<button class="condSelect btn white radius_l">
							<span id="ngict_fm_iui_curalarm_alarmPosition" name_i18n="openo_alarm_i18n"></span>
						</button>
						<span class="cond_selected">
							<span id="ngict_fm_iui_curalarm_locationSelected" name_i18n="openo_alarm_i18n"></span>
						</span>
					</span>
					<span id="alType" class="cond_zone">
						<button class="condSelect btn white radius_l">
							<span id="ngict_fm_iui_curalarm_alarmType" name_i18n="openo_alarm_i18n"></span>
						</button>
						<span class="cond_selected">
							<span id="ngict_fm_iui_curalarm_alarmTypeSelected" name_i18n="openo_alarm_i18n"></span>
						</span>
					</span>
					<span id="alCode" class="cond_zone">
						<button class="condSelect btn white radius_l">
							<span id="ngict_fm_iui_curalarm_probableCause" name_i18n="openo_alarm_i18n"></span>
						</button>
						<span class="cond_selected">
							<span id="ngict_fm_iui_curalarm_probableCauseSelected" name_i18n="openo_alarm_i18n"></span>
						</span>
					</span>
				</div>
				<div class="row cond_zone_time">
					<div class="col-xs-12 confirmTime">
						<label>
							<span id="ngict_fm_iui_curalarm_ackTimeTitle" name_i18n="openo_alarm_i18n"></span>&nbsp;&nbsp;
						</label>
						<input id="today_confirm" type="radio" name="timeConfirm" cond_value="1" cond_id="time" class="btn blue"></input>
						<label for="today_confirm" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recentOneDay" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="one_week_confirm" type="radio" name="timeConfirm" cond_value="2" cond_id="time" class="btn blue"></input>
						<label for="one_week_confirm" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recenttwoDays" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="one_month_confirm" type="radio" name="timeConfirm" cond_value="7" cond_id="time" class="btn blue"></input>
						<label for="one_month_confirm" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recentOneWeek" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="customAckTime" type="radio" name="timeConfirm" class="btn blue"></input>
						<input dtitle="ackTime" id='daterangeConfirm' name="daterange" type='select' value="Custom" data-toggle="tooltip" data-placement="top" title ms-attr-disabled="<!--dataRangeLocationDisabled-->" class='btn btn-default dropdown-toggle' data-toggle='dropdown' />
					</div>
				</div>
				<div class="row cond_zone_time">
					<div class="col-xs-12 confirmTime">
						<label>
							<span id="ngict_fm_iui_curalarm_raisedTime" name_i18n="openo_alarm_i18n"></span>&nbsp;&nbsp;
						</label>
						<input id="today_occur" type="radio" name="timeOccur" cond_value="1" cond_id="time" class="btn blue"></input>
						<label for="today_occur" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recentOneDay" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="one_week_occur" type="radio" name="timeOccur" cond_value="2" cond_id="time" class="btn blue"></input>
						<label for="one_week_occur" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recenttwoDays" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="one_month_occur" type="radio" name="timeOccur" cond_value="7" cond_id="time" class="btn blue"></input>
						<label for="one_month_occur" class="radioLabel">
							<span id="ngict_fm_iui_curalarm_recentOneWeek" name_i18n="openo_alarm_i18n"></span>
						</label>
						<input id="customRaisedTime" type="radio" name="timeOccur" class="btn blue"></input>
						<input dtitle="raisedTime" id='daterangeOccur' name="daterange" type='select' value="Custom" data-toggle="tooltip" data-placement="top" title ms-attr-disabled="<!--dataRangeTypeDisabled-->" class='btn btn-default dropdown-toggle' data-toggle='dropdown' />
					</div>
				</div>
				<div class="row margin-space flRight">
					<button ms-click="searchModal()" class="btn white radius_l">
						<span class="ict-Magnifier alarmsSave"></span>
						<span id="ngict_fm_iui_curalarm_query" name_i18n="openo_alarm_i18n"></span>
					</button>&nbsp;&nbsp;
					<button ms-click="saveModal()" ms-visible="tempHide" class="btn white radius_l">
						<span class="ict-save alarmsSave"></span>
						<span id="ngict_fm_iui_curalarm_save" name_i18n="openo_alarm_i18n"></span>
					</button>
				</div>
			</div>
			<div class="fliterline"></div>
			<div class="row-fluid bodyTop">
				<div class="col-xs-4 alarmbtn">
					<div class="btn-group">
						<button id="affirm" onclick="alarmsUtil.loopAffirm(1);" class="btn white sideBtn" ms-class="btnRiusCircle:!showClear"><span class="ict-acknownledge"></span></button>
						<button id="unAffirm" class="btn white sideBtn" ms-visible="showClear" onclick="alarmsUtil.loopAffirm(2);"><span class="ict-unacknownledge"></span></button>
					</div>
					<button class="btn radius_l white" onclick="alarmsUtil.loopDelAralms();">
						<span class="ict-delete"></span>
						<span id="ngict_fm_iui_curalarm_clean" name_i18n="openo_alarm_i18n"></span>
					</button>
				</div>
				<div class="tablebtn">
					<button class="btn radius_l white" onclick="alarmsUtil.refresh();">
						<span class="ict-refresh"></span>
						<span id="ngict_fm_iui_curalarm_refreash" name_i18n="openo_alarm_i18n"></span>
					</button>
					<button class="btn radius_l white" ms-visible="tempHide">
						<span class="ict-export"></span>
						<span id="ngict_fm_iui_curalarm_exportAll" name_i18n="openo_alarm_i18n"></span>
					</button>
				</div>
			</div>
			<div class="row-fluid" data-name="table_zone">
				<div class="col-xs-12" id='ict_alarms_table_div'></div>
			</div>
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel"><span id="ngict_fm_iui_curalarm_save" name_i18n="openo_alarm_i18n"></span></h4>
						</div>
						<div class="modal-body">
							<span><span id="ngict_fm_iui_curalarm_name" name_i18n="openo_alarm_i18n"></span>&nbsp;&nbsp;</span>
							<input type="text" id="saveCondId"/>
							<div class="condSaveTip">
								<span id="ngict_fm_iui_curalarm_condSaveTip" name_i18n="openo_alarm_i18n"></span>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" id="saveModalCancle" data-dismiss="modal">
								<span id="ngict_fm_iui_curalarm_cancel" name_i18n="openo_alarm_i18n"></span>
							</button>
							<button type="button" class="btn btn-primary" ms-click="alarmsCondSave()">
								<span id="ngict_fm_iui_curalarm_ok" name_i18n="openo_alarm_i18n"></span>
							</button>
						</div>
					</div>
				</div>
			</div>
			<div hidefocus="true" class="modal fade group" id="alCodeTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelCode" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabelCode"><span id="ngict_fm_iui_curalarm_probableCause" name_i18n="openo_alarm_i18n"></span></h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="form-group col-xs-12 margin-top-space">
									<div class="col-xs-6">
										<div class=" right_assign_box">
											<ul id="probableCausesTree" class="ztree"></ul>
										</div>
									</div>
									<div class="col-xs-1 iconPosition">
										<div ms-repeat-el="treeIcons">
											<i treeType="probableCausesTree" ms-class="<!--el-->" ms-click="moveTreeNode($(this))"></i>
										</div>
									</div>
									<div class="col-xs-5">
										<div tabindex="11" class="right-assign-checked-box tree-right-table">
											<table id="selectedProbableCausesTreeTable" class="table table-bordered"></table>
										</div>
									</div>
									<div class="col-xs-4 nodesDetail right">
										<button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="probableCausesTreeAffirm()">
											<span id="ngict_fm_iui_curalarm_ok" name_i18n="openo_alarm_i18n"></span>
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div hidefocus="true" class="modal fade group" id="alTypeTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelType" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabelType"><span id="ngict_fm_iui_curalarm_alarmType" name_i18n="openo_alarm_i18n"></span></h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="form-group col-xs-12 margin-top-space">
									<div class="col-xs-12">
										<div class=" right-assign-checked-box">
											<table id="selectedAlTypeTable" class="table table-bordered tree-left-table"></table>
										</div>
									</div>
									<div class="col-xs-4 nodesDetail right">
										<button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="alTypeTreeAffirm()">
											<span id="ngict_fm_iui_curalarm_ok" name_i18n="openo_alarm_i18n"></span>
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div hidefocus="true" class="modal fade group" id="alLocationTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelLocation" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabelLocation"><span id="ngict_fm_iui_curalarm_alarmPosition" name_i18n="openo_alarm_i18n"></span></h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="form-group col-xs-12 margin-top-space">
									<div class="col-xs-6">
										<div class="right_assign_box">
											<ul id="deptTree" class="ztree"></ul>
										</div>
									</div>
									<div class="col-xs-1 iconPosition">
										<div ms-repeat-el="treeIcons">
											<i treeType="deptTree" ms-class="<!--el-->" ms-click="moveTreeNode($(this))"></i>
										</div>
									</div>
									<div class="col-xs-5">
										<div id="selectedDeptTree" tabindex="11" class="right-assign-checked-box tree-right-table">
											<table id="selectedDeptTreeTable" class="table table-bordered"></table>
										</div>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="form-group col-xs-12">
									<div class="col-xs-4 right">
										<button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="deptTreeAffirm()">
											<span id="ngict_fm_iui_curalarm_ok" name_i18n="openo_alarm_i18n"></span>
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="affirmTrip" class="defaultHideTopLink">
				<span id="ngict_fm_iui_curalarm_affirm" name_i18n="openo_alarm_i18n"></span>
			</div>
			<div id="unAffirmTrip" class="defaultHideTopLink">
				<span id="ngict_fm_iui_curalarm_unaffirm" name_i18n="openo_alarm_i18n"></span>
			</div>
		</div>
		<script src="/openoui/thirdparty/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/jquery-cokie/jquery.cokie.min.js" type="text/javascript" ></script>
		<script src="/openoui/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/bootbox/bootbox.min.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/data-tables/jquery.dataTables-1.9.4.js"></script>
		<script src="/openoui/thirdparty/bootstrap-daterangepicker/moment.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/avalon/avalon.modern.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/icheck/icheck.min.js" type="text/javascript"></script>
		<script src="/openoui/thirdparty/zTree/js/jquery.ztree.all.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/loadi18n.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/json2.js" type="text/javascript"></script>
		<script src="/openoui/monitor/js/tools.js" type="text/javascript"></script>
		<script>
			loadi18n_WebFramework('web-alarm-i18n', 'i18n/', 'openo_alarm_i18n');
			var getUrlParam = function(name){
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
				var search = decodeURIComponent(location.search.substring(1));
				var r = search.match(reg);
				if (r != null) {
					return unescape(r[2]);
				}
				return null;
			}
			$(function(){
				var queryName = getUrlParam("queryId");
				if (queryName) {
					$(".searchTitle").text(queryName);
					$("#saveCondId").val(queryName);
				}
				$('[data-toggle="tooltip"]').tooltip();
			});
		</script>
		<script src="/openoui/performance/js/alarmsServerPageTable.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/alarmsUtil.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/alarmConds.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/commonUtil.js" type="text/javascript"></script>
		<script src="/openoui/performance/js/curAlarmsController.js" type="text/javascript"></script>
	</body>
</html>
